package org.example.com.config;

import jakarta.annotation.Resource;
import org.example.com.interceptor.Firstinterceptor;
import org.example.com.interceptor.Secondinterceptor;
import org.example.com.interceptor.Thirdinterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpringMVCConfig implements WebMvcConfigurer {
    @Resource
    private Firstinterceptor firstinterceptor;
    @Resource
    private Secondinterceptor secondinterceptor;
    @Resource
    private Thirdinterceptor thirdinterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        System.out.println(1111);
        registry.addInterceptor(firstinterceptor).order(1).addPathPatterns("/**");
        registry.addInterceptor(secondinterceptor).order(76).addPathPatterns("/**");
        registry.addInterceptor(thirdinterceptor).order(57).addPathPatterns("/**");
    }
}